﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.Sql;
using System.Data.SqlClient;
using System.Threading;

namespace CMSApplication.Models
{
    public class DB
    {
        private static int baseId = 1;

        public string ConnectionString { get; set; }
        public SqlConnection Conn { get; set; }
        public SqlCommand Command { get; set; }


        //generated keys from insert may work better do the trick, otherwise need one for each table
        public static int getNextId()
        {
            // thread-safe incrementer
            return Interlocked.Increment(ref baseId);
        }
    }
}